package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.service.IMessageHistoryService;
import cn.wolfcode.crm.util.PageResult;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("messageHistory")
public class MessageHistoryController {

    @Autowired
    private IMessageHistoryService messageHistoryService;

    @RequestMapping("")
    public String index() {
        return "messageHistory/list";
    }

    @RequiresPermissions(value = {"discountLevel:view", "会员短信记录列表"})
    @RequestMapping("list")
    @ResponseBody
    public PageResult list(QueryObject qo) {
        PageResult query = messageHistoryService.query(qo);
        return query;
    }

}
